# Maintainer: Jan Alexander Steffens (heftig) <heftig@archlinux.org>

pkgname=python-evdev
pkgver=1.6.1
pkgrel=2
pkgdesc="Python bindings for the Linux input subsystem"
url="https://python-evdev.readthedocs.io/en/latest/"
arch=(x86_64)
license=(BSD)
depends=(python)
makedepends=(python-setuptools python-build python-installer python-wheel git)
_commit=2dd6ce6364bb67eedb209f6aa0bace0c18a3a40a  # tags/v1.6.1^0
source=("git+https://github.com/gvalkov/python-evdev#commit=$_commit")
sha256sums=('SKIP')

pkgver() {
  cd $pkgname
  git describe --tags | sed 's/^v//;s/[^-]*-g/r&/;s/-/+/g'
}

prepare() {
  cd $pkgname
}

build() {
  cd $pkgname
  python -m build --wheel --no-isolation
}

package() {
  cd $pkgname
  python -m installer --destdir="$pkgdir" dist/*.whl
  install -Dt "$pkgdir/usr/share/licenses/$pkgname" -m644 LICENSE
}

# vim:set sw=2 sts=-1 et:
